﻿<%@ Import Namespace="Webdiyer.WebControls.Mvc" %>

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PagedList<MvcProject.Models.RatedInfo>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% using (Html.BeginForm())
       {%>
    <h2>
        定额名称管理</h2>
    <p>
        定额号：
        <%: Html.TextBox("RatedCode")%>
        定额名称：
        <%: Html.TextBox("RatedName")%>
        所属类型
        <%: Html.DropDownList("RatedType", new SelectList(
                       new List<Object> {
                        new { value = "", text = "全部"  }, 
                        new { value = "土建", text = "土建"  }, 
                        new { value = "安装", text = "安装" }, 
                        new { value = "市政", text = "市政" }, 
                        new { value = "园林", text = "园林" } }, "value", "text"))%>
        <input type="submit" value="查询" />
    </p>
    <p>
        <%: Html.ActionLink("创建新定额", "Create") %>
    </p>
    <%=Html.Pager(Model, new PagerOptions { PageIndexParameterName = "page", NextPageText = "下一页", LastPageText = "尾页", PrevPageText = "上一页", FirstPageText="首页" })%>
    <table>
        <tr>
            <th>
                定额号
            </th>
            <th>
                定额名称
            </th>
            <th>
                单位
            </th>
            <th>
                创建时间
            </th>
            <th>
            </th>
        </tr>
        <%if (Model != null) foreach (var item in Model)
              { %>
        <tr>
            <td>
                <%: item.RatedCode %>
            </td>
            <td>
                <%: item.RatedName %>
            </td>
            <td>
                <%: item.RatedUnit %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.CreateDate) %>
            </td>
            <td>
                <%: Html.ActionLink("编辑", "Edit", new { id = item.RatedId })%>
                |
                <%: Html.ActionLink("详细信息", "Details", new { id = item.RatedId }, new { target="_blank"})%>
                |
                <%: Html.ActionLink("删除", "Delete", new { id = item.RatedId })%>
            </td>
        </tr>
        <% } %>
        <% } %>
    </table>
    <%=Html.Pager(Model, new PagerOptions { PageIndexParameterName = "page", NextPageText = "下一页", LastPageText = "尾页", PrevPageText = "上一页", FirstPageText="首页" })%>
</asp:Content>
